home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_d / isamexpt.zip / ISAM_KEY.INT < prev    next >
Text File  |  1996-04-05  |  2KB  |  61 lines

  1. unit Isam_key;
  2. {Copyright 1995 by Norbert Stellberg GmbH}
  3.  
  4. {this unit contains the dialog to set the key for an isamtable}
  5.  
  6. interface
  7.  
  8. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  9.   StdCtrls, ExtCtrls;
  10.  
  11. type
  12.   TIsamKeyDialog = class(TForm)
  13.     {don't call this dialog directly, you better start it
  14.      by the procedure KEY_EINSTELLEN(..), described later
  15.      in this file}
  16.     OKBtn: TBitBtn;
  17.     CancelBtn: TBitBtn;
  18.     Bevel1: TBevel;
  19.     ComboBox1: TComboBox;
  20.   end;
  21.  
  22. var
  23.   IsamKeyDialog: TIsamKeyDialog;
  24.  
  25. Procedure Key_Einstellen(aParent: TForm; var aKey: Integer; Liste: TStringList);
  26. {call this procedure in order to set another key for your isamtable
  27.  with the following parameters:
  28.  APARENT: the form, from which you start the dialog
  29.  AKEY   : the actual key, e.g. ISAMTABLE1.KEYNO
  30.  LISTE  : a stringlist, that contains the names of the possible keys,
  31.           for example if you have 3 keys, key1 on field NAME1,
  32.           key2 on field ZIP and key3 on fields NAME1+NAME2, you must
  33.           create a stringlist, add the names of the keys, before you
  34.           call this procedure:
  35.       procedure T2Dialog.KeyBttnClick(Sender: TObject);
  36.       var Liste: TStringList;
  37.           Key1: Integer;
  38.       begin
  39.         Key1:= T2DialogTable.KeyNo;
  40.         Liste:= TStringList.Create;
  41.         Liste.Add('NAME1');
  42.         Liste.Add('ZIP');
  43.         Liste.Add('NAMES1+2');
  44.         Key_Einstellen(Self,Key1,Liste);
  45.         T2DialogTable.KeyNo:= Key1;
  46.         Liste.Free;
  47.         IsamBrowser1.KeyNumber := Key1;
  48.         Key_Speichern(GetAppName,IsamBrowser1.Name,T2DialogTable.KeyNo);
  49.         IsamBrowser1.SetAndUpdateBrowserScreen('', 0);
  50.       end;}
  51.  
  52. Procedure Key_Speichern(IniName,BrowserName: String; aKey: Integer);
  53. {to save the settings for your isamtable's key in an inifile,
  54.  you can use this procedure with the following parameters:
  55.  ININAME: the name of the application's inifile, e.g. TEST.INI
  56.  BROWSERNAME: the name of the section in the inifile, under which
  57.               you store the settings, e.g. BROWSER1 (without
  58.               brackets ... the section [BROWSER1] will be created.}
  59.  
  60. Implementation
  61.